<?php
	$form	= $this->form;
	$type	= $this->questionType;
	$questionId	= $this->questionId;
	$form->prepare();
	$form->setAttribute('action', $this->url('admin', array('action' => 'editquestion', 'id' => $questionId)));

	$labelQuestion	= $this->formLabel($form->get('content'));
	$question	= $this->formTextarea($form->get('content'));
	$errorQuestion	= $this->formElementErrors($form->get('content'));

	if ($type != 1) {
		$labelChoice1	= $this->formLabel($form->get('choice_1'));
		$choice1	= $this->formTextarea($form->get('choice_1'));
		$errorChoice1	= $this->formElementErrors($form->get('choice_1'));

		$labelChoice2	= $this->formLabel($form->get('choice_2'));
		$choice2	= $this->formTextarea($form->get('choice_2'));
		$errorChoice2	= $this->formElementErrors($form->get('choice_2'));

		$labelChoice3	= $this->formLabel($form->get('choice_3'));
		$choice3	= $this->formTextarea($form->get('choice_3'));
		$errorChoice3	= $this->formElementErrors($form->get('choice_3'));

		$labelChoice4	= $this->formLabel($form->get('choice_4'));
		$choice4	= $this->formTextarea($form->get('choice_4'));
		$errorChoice4	= $this->formElementErrors($form->get('choice_4'));
	}

	switch ($type){
		case 1:
// 			$labelAnswer	= $this->formLabel($form->get('answer1'));
			$answer	= $this->formRadio($form->get('answer1'));
			break;
		case 2:
// 			$labelAnswer	= $this->formLabel($form->get('answer2'));
			$answer	= $this->formMultiCheckbox($form->get('answer2'));
			break;
		case 3:
// 			$labelAnswer	= $this->formLabel($form->get('answer3'));
			$answer	= $this->formRadio($form->get('answer3'));
			break;
	}

	$submit 	= $this->formInput($form->get('submit'));
	echo $this->form()->openTag($this->form);
?>
	<h2 class="sub-header" style="font-weight: bold;">Sửa câu hỏi</h2>
	<div class="form-group">
		<h4><?php echo $labelQuestion; ?></h4>
		<div class="text-danger"><?php echo $errorQuestion; ?></div>
		<?php echo $question; ?>
	</div>
<?php if ($type != 1) { ?>
	<div class="form-group">
		<h4><?php echo $labelChoice1; ?></h4>
		<div class="text-danger"><?php echo $errorChoice1; ?></div>
		<?php echo $choice1; ?>
	</div>
	<div class="form-group">
		<h4><?php echo $labelChoice2; ?></h4>
		<div class="text-danger"><?php echo $errorChoice2; ?></div>
		<?php echo $choice2; ?>
	</div>
	<div class="form-group">
		<h4><?php echo $labelChoice3; ?></h4>
		<div class="text-danger"><?php echo $errorChoice3; ?></div>
		<?php echo $choice3; ?>
	</div>
	<div class="form-group">
		<h4><?php echo $labelChoice4; ?></h4>
		<div class="text-danger"><?php echo $errorChoice4; ?></div>
		<?php echo $choice4; ?>
	</div>
<?php } ?>
	<div class="form-group">
		<h4 style="font-weight: bold;">Đáp án</h4>
		<?php echo $answer; ?>
	</div>
	<?php echo $this->formHidden($form->get('csrf'));?>
	<br>
	<p align="center"><?php echo $submit?></p>
<?php
	echo $this->form()->openTag($this->form);
?>
